<template>
	<view class="p20">
		<u-empty v-if="!list.length"></u-empty>
		<view class="" v-for="(item,index) in list" :key="index">
			<view class="p20 flex">
				<view class="pr fs30 flex1">
					<text>价格{{index+1}}</text>
					<image class="w6 h20" src="/static/img/order/title.png"
						style="position: absolute;left: -24rpx;top: 10rpx;" />
				</view>
				<view class="flex">
					<image src="/static/img/icon/edit.png" class="w34 h34 db"
						@click="$u.route('/pages/my/serve/serveSet')" mode="aspectFit"></image>
					<image src="/static/img/icon/del.png" class="w34 h34 db ml20" @click="serviceDel(item.id,index)"
						mode="aspectFit"></image>
				</view>
			</view>
			<view class="bg-fff radius12 pl20 pr20">
				<view class="flex pt32 pb32 border-b">
					<view class="color-666 ">陪诊项目</view>
					<view class="tr flex1">诊前预约</view>
				</view>
				<view class="flex pt32 pb32 border-b">
					<view class="color-666 ">陪诊医院</view>
					<view class="tr flex1">郑州大学第一附属医院</view>
				</view>
				<view class="flex pt32 pb32 border-b">
					<view class="color-666 ">报价价格</view>
					<view class="tr flex1">￥{{item.minimum_price}}-￥{{item.highest_price}}</view>
				</view>
				<view class="flex pt32 pb32 border-b">
					<view class="color-666 ">一口价价格</view>
					<view class="tr flex1 color-zs">￥{{item.price}}</view>
				</view>
				<view class="flex pt32 pb32 border-b">
					<view class="color-666 flex1">
						<text class="color-red">*</text>
						<text>平台建议价：</text>
						<text class="color-000">￥200</text>
					</view>
					<!-- <switch class="scale7" checked :color="$zs" disabled /> -->
				</view>
				<view class="flex pt32 pb32 border-b">
					<view class="color-666 flex1">
						<text>是否接受一口价最低金额</text>
					</view>
					<switch class="scale7" :checked="item.is_accept==1" :color="$zs" disabled />
				</view>
				<view class="flex pt32 pb32 border-b" v-if="item.is_accept==1">
					<view class="color-666 flex1">
						<text>一口价最低价</text>
					</view>
					<view class="tr flex1">￥{{item.floor_price}}</view>
				</view>
			</view>
		</view>
		<view class="h120"></view>
		<view class="pf bottom0 left0 bg-fff w-max">
			<view class="p20">
				<u-button type="warning" ripple @click="$u.route('/pages/my/serve/serveSet')">添加</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			};
		},
		onShow() {
			this.getList()
		},
		onReachBottom() {
			this.getList('down')
		},
		methods: {
			getList(e) {
				e == 'down' ? this.page++ : this.page = 1
				let params = {
					page: this.page,
				}
				this.$request('/master/my/serviceList', params).then(res => {
					let list = res.data.data || []
					e == 'down' ? this.list.push(...list) : this.list = list
				})
			},
			serviceDel(id,index) {
				this.$showModal('删除').then(res => {
					this.$request('/master/my/serviceDel', {id}).then(res => {
						this.$msg(res.msg)
						// this.getList()
						 this.list.splice(index,1)
					})
				})
			},

		}
	}
</script>

<style lang="scss">

</style>
